from multiprocessing import Process
class ProcessWorker(Process):
    def __init__(self, target, args=()):
        super().__init__()
        self.target = target
        self.args = args

    def run(self):
        self.target(*self.args)

# 一个示例函数，用于作为ProcessWorker的目标
def example_function(*args):
    print(args)

if __name__ == '__main__':
    # 创建ProcessWorker实例
    worker = ProcessWorker(target=example_function, args=(1, 2, 3))
    # 启动进程
    worker.start()
    # 等待进程结束
    worker.join()